package com.lh.createBean;

import org.springframework.util.SerializationUtils;

import java.io.Serializable;

public class MySerializable {

    public static void main(String[] args) {

        Student student = new Student();

        //进行序列化
        byte[] bytes = SerializationUtils.serialize(student);

        //进行繁序列化
        Student studentSerial = (Student) SerializationUtils.deserialize(bytes);

        System.out.println("-------序列化不会调用无参构造方法---------");
        System.out.println(student == studentSerial); //false

    }

}
